<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="new :: common_head('所有设备')">
    <style>
        .changeI{
            display: block;
            width: 100%;
            height: 100%;
        }
        ul li{
            list-style: none;
            margin: 0;
            padding: 0;
        }
        .navbar .nav > li > .dropdown-menu::before {
            display: none!important;
        }
        .navbar .nav > li > .dropdown-menu::after {
            display: none !important;
        }
        .dropdown-menu:hover, .dropdown-menu:hover{
            display: none !important;
        }
        .dropdown-menu:hover::before, .dropdown-menu:hover::after{
            display: none !important;
        }
        #myli >ul:hover::before{
            display: none;
        }
    </style>
</head>

<body>
<!--删除提示模态框-->
<div class="modal fade" id="delcfmModel1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title" id="myModalLabel">提示</h4>
            </div>
            <div class="modal-body">是否要删除？</div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" onclick="deleteDeviceById()">确定</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div>
<!--删除提示模态框结束-->
<!-- start: Header -->
<div th:replace="~{new::header}"></div>
<!-- start: Header -->

<div class="container-fluid-full">
    <div class="row-fluid">

        <!-- start: Main Menu -->
        <div id="sidebar-left" class="span2" th:replace="new::sidebar_left"></div>
        <!-- end: Main Menu -->

        <noscript>
            <div class="alert alert-block span10">
                <h4 class="alert-heading">Warning!</h4>
                <p>You need to have <a href="" target="_blank">JavaScript</a> enabled to use this site.</p>
            </div>
        </noscript>

        <!-- start: Content -->
        <div id="content" class="span10">


            <ul class="breadcrumb">
                <li>
                    <i class="icon-home"></i>
                    <a th:href="@{/new.html}">主页</a>
                    <i class="icon-angle-right"></i>
                </li>
                <li><a href="#">设备展示</a></li>
            </ul>

            <div class="row-fluid sortable">
                <div class="box span12">
                    <div class="box-header" data-original-title>
                        <h2><i class="halflings-icon white user"></i><span class="break"></span>设备展示</h2>
                        <div class="box-icon">

                        </div>
                    </div>
                    <div class="box-content">
                        <!--添加设备开始-->
                        <div class="container" style="margin-left: 0px">
                            <ul id="mytab" class="nav nav-pills nav-justified">
                                <li role="presentation" class="dropdown" id="myli"><a href="#" class="dropdown-toggle"
                                                                                      data-toggle="dropdown">添加设备
                                    <span class="caret"></span></a>
                                    <ul class="dropdown-menu">
                                        <li><a th:href="@{/device/add/1}">产能设备</a></li>
                                        <li><a th:href="@{/device/add/2}">储能设备</a></li>
                                        <li><a th:href="@{/device/add/3}">用能设备</a></li>
                                    </ul>
                                </li>
                            </ul>
                        </div>
                        <!--添加设备结束-->
                        <div  class="container" style="margin-left:0px"><!-- 设备列表切换开始 -->
                            <ul id="mytab1" class="nav nav-pills nav-justified" role="tablist">
                                <li role="presentation" class="active" id="ligetAll"><a th:href="@{/device/getAll}">所有设备</a></li>
                                <li role="presentation" id="li1"><a th:href="@{/device/1}">产能设备</a></li>
                                <li role="presentation" id="li2"><a th:href="@{/device/2}">储能设备</a></li>
                                <li role="presentation" id="li3"><a th:href="@{/device/3}">用能设备</a></li>
                            </ul>
                        </div><!-- 设备列表切换结束 -->

                        <!--设备列表开始-->
                        <table class="table table-striped table-bordered bootstrap-datatable datatable">
                            <thead>
                            <tr>
                                <th>设备ID</th>
                                <th>设备名</th>
                                <th>能量编码</th>
                                <th>电量编码</th>
                                <th>内温编码</th>
                                <th>所属图谱</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                                <tr th:each="device:${deviceList}">
                                    <td th:text="${device.deviceId}"></td>
                                    <td class="center" th:text="${device.deviceName}"></td>
                                    <td class="center" th:text="${device.devCode}"></td>
                                    <td class="center" th:text="${device.batteryCode}"></td>
                                    <td class="center" th:text="${device.temperatureCode}"></td>
                                    <td class="center" th:text="${device.graphName}"></td>
                                    <td class="center">
                                        <!-- 查看字体图标开始-->
                                        <a class="btn btn-success" title="查看" th:href="@{/device/getDeviceInfo/}+${device.deviceId}">
                                            <i class="halflings-icon white zoom-in"></i>
                                        </a>
                                        <!-- 修改字体图标结束-->
                                        <a class="btn btn-info" title="修改" th:href="@{/device/get/}+${device.deviceId}">
                                            <i class="halflings-icon white edit"></i>
                                        </a>
                                        <!--<a  class="btn btn-danger" >-->
                                            <!--<i th:id="${device.deviceId}" class="halflings-icon white trash changeI"  onclick="deleteDevice()"></i>-->
                                        <!--</a>-->
                                        <a  class="btn btn-danger" href="#" title="删除" th:id="${device.deviceId}" onclick="deleteDevice()">
                                           删除
                                        </a>
                                    </td>
                                </tr>
                            </tbody>

                        </table>
                        <!--设备列表结束-->
                    </div>
                </div>
            </div>
        </div><!--/.fluid-container-->
        <!-- end: Content -->
    </div><!--/#content.span10-->
</div><!--/fluid-row-->

<div class="modal hide fade" id="myModal">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">×</button>
        <h3>Settings</h3>
    </div>
    <div class="modal-body">
        <p>Here settings can be configured...</p>
    </div>
    <div class="modal-footer">
        <a href="#" class="btn" data-dismiss="modal">Close</a>
        <a href="#" class="btn btn-primary">Save changes</a>
    </div>
</div>
<div class="common-modal modal fade" id="common-Modal1" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-content">
        <ul class="list-inline item-details">
            <li><a href="http://sc.chinaz.com">Admin templates</a></li>
            <li><a href="http://sc.chinaz.com">Bootstrap themes</a></li>
        </ul>
    </div>
</div>
<div class="clearfix"></div>


<div th:replace="new::common_js"></div>
<script>
    //获取当前点击的设备菜单，添加高亮显示
    $(document).ready(function () {
        var location=window.location.href;//获取url
        var id=location.substring(location.lastIndexOf('/')+1);
        $("#"+"li"+id).addClass("active").siblings().removeClass("active");//给对应的li高亮
    })
</script>
</body>
</html>
